Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: single-sig IPEX apply, offer, agree #234

Conversation

iFergal
Copy link
Contributor

@iFergal iFergal commented Mar 21, 2024

To accompany WebOfTrust/keria#198.

* feat: IPEX apply, offer, admit msgs

* test: apply, offer, agree integration tests

* fix: correct typing

* test: ipex unit tests

* test: improve test and docs

* test: ipex better split of unit tests

* test: whitespace diff
src/keri/app/credentialing.ts Show resolved Hide resolved
m: args.message ?? '',
s: args.schema,
a: args.attributes ?? {},
i: args.recipient,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure on when i should be part of the attributes here. It is for grant and not for apply. From what I remember when checking out keripy, it seems to auto add i if an exn message is created there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iFergal Do you have a link to the lines of code in keripy where this is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@lenkan lenkan Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look here and it is being done in here as well:

if (recipient !== undefined) {
attrs['i'] = recipient;
}
const a = {
...attrs,
...payload,
};
const _ked = {
v: vs,
t: ilk,
d: '',
i: sender,
p: p,
dt: dt,
r: route,
q: q,
a: a,
e: e,
};

I think this is more explicit, we can amend the interface for the payload parameter in createExchangeMessage to be something like

interface ExchangeMessageData {
   [key: string]: unknown,
   /**
     * The recipient of the message
     */
   i: string
}

that way there is only one way to specify the recipient and we can remove the recipient parameter. This would be more in line with the changes I proposed in #222.

I don't mean to make that change here, but it could be done as a separate PR to tidy up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, though that line of code is never being hit for IPEX since recipient is always passed as undefined to createExchangeMessage. The only other place that createExchangeMessage is called is from the send method of exchanges, which also doesn't pass the recipient.

Maybe @pfeairheller can shed more light on when it should be passed as an attribute too (at least for IPEX).

But agree on the interface tidy up, makes sense to me.

Copy link
Contributor Author

@iFergal iFergal May 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lenkan We discussed this in the dev call today, and I also can see you have #252 open that also does this. I've pushed the change for the CICD and compose file only to see if it will pass now. Not sure if additionally all of the other changes you have in draft are required too or not with this new version.

cc @rodolfomiranda

Edit - OK, looks like the tests are indeed broken for the new version

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iFergal The changes in aiding.ts is needed for the upgrade. The other changes were only to highlight what is broken.

Copy link
Contributor Author

@iFergal iFergal May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lenkan Do you think that PR will merge this week or shall I cherry pick changes to aiding.ts across?

edit - hitting this now, will try to dig into why when I've more time. (on first call to await grantMultisig)

HTTP POST /identifiers/GEDA/ipex/grant - 400 Bad Request - {"title": "400 Bad Request", "description": "attempt to send to unknown AID=EJSc85y7RLnwYDU1BGuVKAY8GKde6zvbEFOgkP-aOEBR"}

Copy link
Collaborator

@lenkan lenkan May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that is the exact same error I reproduced in #252. I created the issue in keria that needs resolution WebOfTrust/keria#230. I have not yet debugged keria for that issue.

It would be good to see if it can be reproduced in plain keripy first I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some other adjustments in my latest push - smids/rmids only changed on group creation, not rotation.

There were also some changes in keripy on not using hard coded salts so our tests can't assume the agent AID anymore.

Once WebOfTrust/keria#243 merges, the only failing test is the one you described for vlei issuance. Haven't got a chance to support on that yet.

@lenkan lenkan self-requested a review April 4, 2024 14:43
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.90%. Comparing base (6113497) to head (5409fea).

Current head 5409fea differs from pull request most recent head 7af8741

Please upload reports for the commit 7af8741 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #234      +/-   ##
==========================================
- Coverage   83.51%   82.90%   -0.62%     
==========================================
  Files          46       46              
  Lines        4210     4246      +36     
  Branches     1047     1057      +10     
==========================================
+ Hits         3516     3520       +4     
- Misses        690      721      +31     
- Partials        4        5       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lenkan lenkan mentioned this pull request Apr 11, 2024
@lenkan lenkan changed the base branch from development to main April 12, 2024 19:58
@rodolfomiranda rodolfomiranda merged commit 140ecd7 into WebOfTrust:main Jul 16, 2024
iFergal added a commit to cardano-foundation/signify-ts that referenced this pull request Jul 16, 2024
lenkan pushed a commit that referenced this pull request Jul 16, 2024
* Revert "feat: single-sig IPEX apply, offer, agree (#234)"

This reverts commit 140ecd7.

* build: lock to 0.1.3 KERIA tag for now
@iFergal iFergal deleted the feat/singleSigIpexApplyOfferAgree branch October 2, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants